<?php
use yii\db\Schema;
use yii\db\Migration;

/**
 * 用户文件关系表
 *
 * @author jois
 */
class m150828_065221_create_userfile_table extends Migration
{

    public function up()
    {
        $this->createTable('userfile', [
            'id' => Schema::TYPE_PK,
            'user_id' => Schema::TYPE_INTEGER,
            'storage_hash' => 'CHAR(32) NOT NULL',
            'created_at' => Schema::TYPE_INTEGER . ' NOT NULL',
            'updated_at' => Schema::TYPE_INTEGER . ' NOT NULL',
        ]);
    }

    public function down()
    {
        $this->dropTable('userfile');
    }
}
